package com.iceland.server.service;

import com.iceland.server.server.proxy.ProxyServerManager;
import com.iceland.server.server.Server;


public class ServerService  implements RegisterProxyService {
    ProxyServerManager proxyServerManager=ProxyServerManager.getSingleInstance();

    @Override
    public Server startProxyServer(int port) {
        try {
            port = proxyServerManager.addServer(port);
            return proxyServerManager.getServer(port);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public void closeProxyServer(int port) {
        proxyServerManager.closeServer(port);
    }
}
